\documentclass[12pt]{article}

\usepackage[margin=1in]{geometry}
\usepackage[T1]{fontenc}
\usepackage[utf8]{inputenc}
\usepackage{newtxtext,newtxmath} % Times-like text + math
\usepackage{setspace}
\usepackage{microtype}
\usepackage{graphicx}
\usepackage{booktabs}
\usepackage{threeparttable}
\usepackage{longtable}
\usepackage{caption}
\usepackage{subcaption}
\usepackage{amsmath}
\usepackage{hyperref}
\usepackage[natbibapa]{apacite}
\usepackage{fancyhdr}
\usepackage{indentfirst}

\hypersetup{
  colorlinks=true,
  linkcolor=blue,
  urlcolor=blue,
  citecolor=blue
}

\doublespacing

% --- APA-ish heading helpers (APA 7 style: title case, max 5 levels) ---
% Level 1: Centered, Bold
\newcommand{\APAHeadingOne}[1]{%
  \vspace{0.12in}%
  \begin{center}\textbf{#1}\end{center}%
  \vspace{0.06in}%
}
% Level 2: Flush Left, Bold
\newcommand{\APAHeadingTwo}[1]{%
  \vspace{0.10in}%
  \noindent\textbf{#1}\par%
}
% Level 3 (APA 7): Flush Left, Bold Italic, run-in with text on same line
\newcommand{\APAHeadingThree}[1]{%
  \vspace{0.08in}%
  \noindent\textbf{\textit{#1}.}\hspace{0.5em}%
}

% Running head + page number (top right)
\pagestyle{fancy}
\fancyhf{}
\fancyhead[R]{INTERNET ROLLOUT \ \thepage}
\renewcommand{\headrulewidth}{0pt}

\setlength{\parindent}{0.5in}

\begin{document}

% Page 1: Title + Abstract + Keywords only (anonymous main document)
\begin{center}
\textbf{Does Broadband Rollout Mobilize Citizens?\\ A Design-Based Reassessment Using the European Social Survey}
\end{center}

\vspace{0.25in}

\begin{center}
\textbf{Abstract}
\end{center}

\input{sections/00_abstract}

\vspace{0.15in}
\noindent\textbf{Keywords:} internet use; political participation; inequality; instrumental variables; broadband rollout

\newpage

% Page 2: Title (centered) + main text begins immediately
\begin{center}
\textbf{Does Broadband Rollout Mobilize Citizens?\\ A Design-Based Reassessment Using the European Social Survey}
\end{center}

\input{sections/01_introduction}

\APAHeadingOne{Literature Review}
\input{sections/02_theory}

\APAHeadingOne{Methods}
\APAHeadingTwo{Data and Measures}
\input{sections/03_data}

\APAHeadingTwo{Identification Strategy}
\input{sections/04_identification}

\APAHeadingOne{Results}
\input{sections/05_results}

\APAHeadingOne{Robustness and Diagnostics}
\input{sections/06_robustness}

\APAHeadingOne{Discussion and Conclusion}
\input{sections/07_discussion}

\APAHeadingOne{Data Availability}
\input{sections/08_data_availability}

\newpage

\begin{center}
\textbf{References}
\end{center}

\bibliographystyle{apacite}
\bibliography{references}

% Tables and figures should appear after references (each on a separate page)
\clearpage

\begin{center}\textbf{Tables}\end{center}
\clearpage

\begin{table}[p]
\caption{OLS vs IV (absorbed fixed effects): Observational associations vs rollout-based causal estimates}
\label{tab:ols-vs-iv}
\centering
\setlength{\tabcolsep}{3pt}
\renewcommand{\arraystretch}{1.05}
\resizebox{\textwidth}{!}{\input{tables/iv_shiftshare_ols_vs_iv.tex}}
\end{table}
\clearpage

\begin{table}[p]
\caption{Mechanism and attitudinal proxies}
\label{tab:mech}
\centering
\setlength{\tabcolsep}{3pt}
\renewcommand{\arraystretch}{1.05}
\resizebox{\textwidth}{!}{\input{tables/iv_shiftshare_mechanisms.tex}}
\end{table}
\clearpage

\begin{center}\textbf{Figures}\end{center}
\clearpage

\begin{figure}[p]
\caption{OLS vs rollout-IV estimates by outcome and education}
\label{fig:ols-vs-iv}
\centering
\includegraphics[width=\textwidth]{figures/fig1_ols_vs_iv_panels.png}
\begin{flushleft}
\textit{Note.} Panel A plots absorbed-FE OLS estimates; Panel B plots 2SLS (shift-share rollout IV) estimates. Points are coefficients and lines are 95\% CIs. High-education effects are implied as $b(\mathrm{LowEdu}) + \Delta(\mathrm{High{-}Low})$.
\end{flushleft}
\end{figure}
\clearpage

\begin{figure}[p]
\caption{Instrument strength and placebo outcomes under the rollout-IV design}
\label{fig:firststage-placebo}
\centering
\includegraphics[width=\textwidth]{figures/fig2_firststage_placebo_panels.png}
\begin{flushleft}
\textit{Note.} Panel A shows first-stage F-statistics for the endogenous regressors across outcomes (2SLS). Panel B shows placebo estimates for predetermined outcomes (gender; born in country). Randomization inference for first-stage strength based on timing permutations is reported in the online supplement (Figure~S1).
\end{flushleft}
\end{figure}

\end{document}
